<template>
	<view style="position: relative;padding: 20rpx;">
		<u--form labelPosition="left" :model="info" :rules="rules" ref="uForm">
			<u-form-item label="产品名称" prop="name"  :labelWidth="labelWidth" :borderBottom="true" required>
				<input class="input" placeholder="请输入" placeholder-class="place" v-model="info.name"/>
			</u-form-item>
			<u-form-item label="规格" prop="scale"  :labelWidth="labelWidth" :borderBottom="true" required>
				<input class="input" placeholder="请输入" placeholder-class="place" v-model="info.scale"/>
			</u-form-item>
			<u-form-item label="数量" prop="num"  :labelWidth="labelWidth" :borderBottom="true" required>
				<input class="input" placeholder="请输入" placeholder-class="place" v-model="info.num"/>
			</u-form-item>
			<u-form-item label="单价" prop="price"  :labelWidth="labelWidth" :borderBottom="true" required>
				<input class="input" placeholder="请输入" placeholder-class="place" v-model="info.price"/>
			</u-form-item>
		</u--form>
		<view class="bottom row-center" @click="submit">
			确定
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				labelWidth:120,
				info:{
					'name':'',
					'scale':'',
					'num':'',
					'price':'',
					
				},
				rules: {
					'name': {
						type: 'string',
						required: true,
						message: '请输入名称',
						trigger: ['blur', 'change']
					},
					'scale': {
						type: 'string',
						required: true,
						message: '请输入规格',
						trigger: ['blur', 'change']
					},
					'num': {
						type: 'string',
						required: true,
						message: '请输入数量',
						trigger: ['blur', 'change']
					},
					'price': {
						type: 'string',
						required: true,
						message: '请输入价格',
						trigger: ['blur', 'change']
					},
				}
			}
		},
		methods: {
			submit(){
					this.$refs.uForm.validate().then(res => {
								uni.$u.toast('校验通过')
								uni.navigateTo({
									url:'/src/pages/other/registeStatus'
								})
							}).catch(errors => {
								uni.$u.toast('校验失败')
					})
			},
		}
	}
</script>

<style>
	page{
		background: white;
	}
</style>
<style scoped lang="scss">
.bottom{
	margin-left: 36rpx ;
	margin-right: 32rpx;
	width: calc(100% - 72rpx);
	position: fixed;
	bottom: 0;
	border-radius: 40rpx;
	background: #3B60D3;
	height: 80rpx;
	color: #FFF;
	font-size: 32rpx;
	font-style: normal;
	font-weight: 500;
	line-height: 48rpx; /* 150% */
}
</style>
